﻿using System;

namespace FNN.NetworkComponents
{
    [Serializable]
    public class NetworkTransaction
    {
        private bool _transactionType;
        private double _price;
        private double _quantity;
        private DateTime _transactionDate;

        /// <summary>
        ///     Конструктор копирования
        /// </summary>
        /// <param name="source">Исходный экзмемпляр</param>
        public NetworkTransaction(NetworkTransaction source)
        {
            _transactionType = source.TransactionType;
            _price = source.Price;
            _quantity = source.Quantity;
            _transactionDate = source.TransactionDate;
        }

        /// <summary>
        ///     Тип транзакции
        /// </summary>
        public bool TransactionType
        {
            get { return _transactionType; }
            set { _transactionType = value; }
        }

        /// <summary>
        ///     Цена
        /// </summary>
        public double Price
        {
            get { return _price; }
            set { _price = value; }
        }

        /// <summary>
        ///     Количество
        /// </summary>
        public double Quantity
        {
            get { return _quantity; }
            set { _quantity = value; }
        }

        /// <summary>
        ///     Время транзакции
        /// </summary>
        public DateTime TransactionDate
        {
            get { return _transactionDate; }
            set { _transactionDate = value; }
        }

        /// <summary>
        ///     Конструктор с параметрами
        /// </summary>
        /// <param name="type">Тип</param>
        /// <param name="price">Цена</param>
        /// <param name="quantity">Количество</param>
        /// <param name="operationDate">Время операции</param>
        public NetworkTransaction(bool type, double price, double quantity, DateTime operationDate)
        {
            _transactionType = type;
            _price = price;
            _quantity = quantity;
            _transactionDate = operationDate;
        }
    }
}
